package com.promise.jokerdream.config.game

import kotlinx.serialization.Serializable

@Serializable
data class ConstellationGameConfig(
    override val enabledSetting: Boolean = true,
    override val scheduledChallengeEnabled: Boolean = false,
    override val registrationTime: String = "",
    // 当前关卡
    val levelName: String = "",
): BaseGameConfig {
    
    /**
     * 获取关卡ID
     * 支持格式：1-白羊宫 或 纯数字
     * @return 关卡ID，如果解析失败返回null
     */
    fun getSceneId(): Int? {
        return if (levelName.contains("-")) {
            levelName.split("-").firstOrNull()?.toIntOrNull()
        } else {
            levelName.toIntOrNull()
        }
    }
}
